#! /bin/bash
#导入日历表calender数据
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select * from calendar where 1=1 and  \$CONDITIONS" \
--hcatalog-database oe_ods \
--hcatalog-table ods_calendar \
-m 1

#导入班级在读人数统计表class_studying_student_count数据
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select *,studying_date as dt from class_studying_student_count where 1=1 and  \$CONDITIONS" \
--hcatalog-database oe_ods \
--hcatalog-table ods_class_studying_student_count \
-m 1

#导入课程信息表course_table_upload_detail数据
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select *,class_date as dt from course_table_upload_detail where 1=1 and  \$CONDITIONS" \
--hcatalog-database oe_ods \
--hcatalog-table ods_course_table_upload_detail \
-m 1

#导入请假信息表student_leave_apply数据
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select *,substring(create_time,1,10) as dt from student_leave_apply where 1=1 and  \$CONDITIONS" \
--hcatalog-database oe_ods \
--hcatalog-table ods_student_leave_apply \
-m 1

#导入作息时间表数据tbh_class_time_table数据
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select * from tbh_class_time_table where 1=1 and  \$CONDITIONS" \
--hcatalog-database oe_ods \
--hcatalog-table ods_tbh_class_time_table \
-m 1

#导入学生打卡表tbh_student_signin_record数据
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/teach?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select *,signin_date as dt from tbh_student_signin_record where 1=1 and  \$CONDITIONS" \
--hcatalog-database oe_ods \
--hcatalog-table ods_tbh_student_signin_record \
-m 1